package com.api.rc.dao;

import com.api.core.ApiMapper;
import com.api.rc.model.Room;
import com.api.rc.model.temp.HostMatchingHistory;
import com.api.rc.vo.RcOverviewVo;
import com.api.rc.vo.RoomVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author RenQiang
 * @date 2021/7/12
 */
@Mapper
public interface RoomMapper extends ApiMapper<Room> {
    /**
     * 分页查询房间
     *
     * @param queryParams
     * @return
     */
    List<RoomVo> list(@Param("queryParams") Map<String, Object> queryParams);

    /**
     * 计算并更新房间的主持人评分
     *
     * @param roomId
     */
    void calcAndUpdateRoomHostStar(@Param("roomId") Long roomId);

    /**
     * 获取总览
     *
     * @return
     */
    RcOverviewVo getOverview();

    /**
     * 查询主持人所有匹配历史
     *
     * @param hostId
     * @return
     */
    List<HostMatchingHistory> findHostHistoryByRoomId(@Param("hostId") Long hostId);
}
